﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using NewsAggregatorLibrary;

namespace NewsAggregator
{
    public partial class _Default : Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            FetchTopTenStories();
        }

        public void FetchTopTenStories() {
            DateTime today = DateTime.Now;
            DateTime lastSeven = today+ TimeSpan.FromDays(-7);
            StoriesMemberCollection s = StoriesMember.RetrieveTop10(lastSeven, today);
            topStroriesRepeater.DataSource = s;
            topStroriesRepeater.DataBind();         
        }
    }
}